package com.kmproject.haifu.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kmproject.haifu.R;
import com.kmproject.haifu.app.utils.AppUtil;
import com.kmproject.haifu.mvp.model.entity.beans.HouseMainBean;

import java.util.List;

public class HouseRentingShowMainItemAdapter extends BaseQuickAdapter<HouseMainBean.HouseMainItem, BaseViewHolder> {
    public HouseRentingShowMainItemAdapter(@Nullable List<HouseMainBean.HouseMainItem> data) {
        super(R.layout.houserenting_main_item_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HouseMainBean.HouseMainItem item) {
        helper.<ImageView>getView(R.id.houserenting_main_item_item_img).setImageResource(item.getImgId());
        helper.<TextView>getView(R.id.houserenting_main_item_item_txt).setText(item.getItemName());
        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AppUtil.gotoActivityForType(item);
            }
        });
    }
}
